<?php
/**********************************************************************************
WIKINDX: Bibliographic Management system.
Copyright (C)

This program is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program;
if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

The WIKINDX Team 2007
sirfragalot@users.sourceforge.net
**********************************************************************************/
/*****
*	COINS Map class.
*	Provides mappings for COINS (Firefox, Navigator etc.)
*
*	$Header: /cvsroot/wikindx/wikindx3/core/file/COINSMAP.php,v 1.1 2007/10/21 12:01:56 sirfragalot Exp $
*****/
class COINSMAP
{
// Constructor
	function COINSMAP()
	{
		$this->loadMap();
	}
/*
* Create arrays based on database table and resource type mapping wikindx resource fields to Coins elements.
* The arrays are named for WIKINDX resource types.
*
* Creators and dates are handled in the PHP code
*
* @author Mark Grimshaw
* @version 1
*/
	function loadMap()
	{
		$this->coinsBase = 'class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3A';
// WIKINDX resource types (keys) and their COINS equivalent.
// NB COins/OpenURL is extremely limited in its types (as of v1.0), for unsupported types, use 'book' and genre == 'unknown'.
		$this->types = array(
// Edit values if necessary
			'book'			=>	'book',
			'book_article'		=>	'book',
			'book_chapter'		=>	'book',
			'journal_article'	=>	'journal',
			'newspaper_article'	=>	'journal',
			'magazine_article'	=>	'journal',
			'proceedings'		=>	'book',
			'conference_paper'	=>	'book',
			'proceedings_article'	=>	'journal',
			'thesis'		=>	'dissertation',
			'web_site'	=>	'journal',
			'web_article'		=>	'journal',
			'web_encyclopedia'	=>	'journal',
			'web_encyclopedia_article'	=>	'journal',
			'film'			=>	'book',
			'broadcast'		=>	'book',
			'music_album'		=>	'book',
			'music_track'		=>	'book',
			'music_score'		=>	'book',
			'artwork'		=>	'book',
			'software'		=>	'book',
			'audiovisual'		=>	'book',
			'database'		=>	'book',
			'government_report'	=>	'book',
			'report'		=>	'book',
			'hearing'		=>	'book',
			'statute'		=>	'book',
			'legal_ruling'		=>	'book',
			'case'			=>	'book',
			'bill'			=>	'book',
			'patent'		=>	'patent',
			'personal'		=>	'book',
			'unpublished'		=>	'book',
			'classical'		=>	'book',
			'manuscript'		=>	'book',
			'map'			=>	'book',
			'chart'			=>	'book',
			'miscellaneous'		=>	'book',
			'miscellaneous_section'		=>	'book',
		);
// Some wikindx types have no Coins genre
		$this->genres = array(
			'book'			=>	'book',
			'book_article'		=>	'bookitem',
			'book_chapter'		=>	'bookitem',
			'journal_article'	=>	'article',
			'newspaper_article'	=>	'article',
			'magazine_article'	=>	'article',
			'proceedings'		=>	'conference',
			'conference_paper'	=>	'proceeding',
			'proceedings_article'	=>	'proceeding',
			'thesis'		=>	FALSE,
			'web_site'	=>	'article',
			'web_article'		=>	'article',
			'web_encyclopedia'	=>	'journal',
			'web_encyclopedia_article'	=>	'article',
			'film'			=>	'unknown',
			'broadcast'		=>	'unknown',
			'music_album'		=>	'book',
			'music_track'		=>	'bookitem',
			'music_score'		=>	'unknown',
			'artwork'		=>	'unknown',
			'software'		=>	'unknown',
			'audiovisual'		=>	'unknown',
			'database'		=>	'unknown',
			'government_report'	=>	'report',
			'report'		=>	'report',
			'hearing'		=>	'unknown',
			'statute'		=>	'unknown',
			'legal_ruling'		=>	'unknown',
			'case'			=>	'unknown',
			'bill'			=>	'unknown',
			'patent'		=>	FALSE,
			'personal'		=>	'unknown',
			'unpublished'		=>	'unknown',
			'classical'		=>	'unknown',
			'manuscript'		=>	'unknown',
			'map'			=>	'unknown',
			'chart'			=>	'unknown',
			'miscellaneous'		=>	'unknown',
			'miscellaneous_section'		=>	'unknown',
		);
/**
* Basic array of elements common to all types - change the key to map the database field that stores that value.
*/
		$this->basic = array(
			);		
// Resource specific mappings. The order here is the display order when editing/creating styles.
// BOOK
		$this->book = $this->basic;
		$this->book['title'] = 'btitle';
		$this->book['field1'] = 'series';
		$this->book['field2'] = 'edition';
		$this->book['publisherName'] = 'pub';
		$this->book['publisherLocation'] = 'place';
		$this->book['isbn'] = 'isbn';
		$this->book['field6'] = 'tpages';
// BOOK ARTICLE
		$this->book_article = $this->basic;
		$this->book_article['title'] = 'atitle';
		$this->book_article['field1'] = 'series';
		$this->book_article['field2'] = 'edition';
		$this->book_article['publisherName'] = 'pub';
		$this->book_article['publisherLocation'] = 'place';
		$this->book_article['collectionTitle'] = 'btitle';
		$this->book_article['pageStart'] = 'spage';
		$this->book_article['pageEnd'] = 'epage';
		$this->book_article['isbn'] = 'isbn';
// BOOK CHAPTER
		$this->book_chapter = $this->basic;
		$this->book_chapter['title'] = 'atitle';
		$this->book_chapter['field1'] = 'series';
		$this->book_chapter['field2'] = 'edition';
		$this->book_chapter['publisherName'] = 'pub';
		$this->book_chapter['publisherLocation'] = 'place';
		$this->book_chapter['collectionTitle'] = 'btitle';
		$this->book_chapter['pageStart'] = 'spage';
		$this->book_chapter['pageEnd'] = 'epage';
		$this->book_chapter['isbn'] = 'isbn';
// JOURNAL ARTICLE
		$this->journal_article = $this->basic;
		$this->journal_article['title'] = 'atitle';
		$this->journal_article['field1'] = 'volume';
		$this->journal_article['field2'] = 'issue';
		$this->journal_article['collectionTitle'] = 'jtitle';
		$this->journal_article['pageStart'] = 'spage';
		$this->journal_article['pageEnd'] = 'epage';
		$this->journal_article['isbn'] = 'issn';
		$this->journal_article['shortTitle'] = 'stitle';
// NEWSPAPER ARTICLE
		$this->newspaper_article = $this->basic;
		$this->newspaper_article['title'] = 'atitle';
		$this->newspaper_article['collectionTitle'] = 'jtitle';
		$this->newspaper_article['collectionTitleShort'] = 'stitle';
		$this->newspaper_article['pageStart'] = 'spage';
		$this->newspaper_article['pageEnd'] = 'epage';
		$this->newspaper_article['isbn'] = 'issn';
// MAGAZINE ARTICLE
		$this->magazine_article = $this->basic;
		$this->magazine_article['title'] = 'atitle';
		$this->magazine_article['collectionTitle'] = 'jtitle';
		$this->magazine_article['collectionTitleShort'] = 'stitle';
		$this->magazine_article['field4'] = 'volume';
		$this->magazine_article['field3'] = 'issue';
		$this->magazine_article['pageStart'] = 'spage';
		$this->magazine_article['pageEnd'] = 'epage';
		$this->magazine_article['isbn'] = 'issn';
// PROCEEDINGS ARTICLE
		$this->proceedings_article = $this->basic;
		$this->proceedings_article['title'] = 'atitle';
		$this->proceedings_article['collectionTitle'] = 'jtitle';
		$this->proceedings_article['publisherName'] = 'pub';
		$this->proceedings_article['publisherLocation'] = 'place';
		$this->proceedings_article['pageStart'] = 'spage';
		$this->proceedings_article['pageEnd'] = 'epage';
		$this->proceedings_article['isbn'] = 'issn';
// THESIS
		$this->thesis = $this->basic;
		$this->thesis['title'] = 'title';
		$this->thesis['field1'] = 'degree'; // 'Master's', 'PhD', 'Doctoral', 'Diploma' etc.
		$this->thesis['publisherName'] = 'inst';
		$this->thesis['publisherLocation'] = 'co';
		$this->thesis['isbn'] = 'isbn';
		$this->thesis['field6'] = 'tpages';
// WEB SITE
		$this->web_site = $this->basic;
		$this->web_site['title'] = 'atitle';
// WEB ARTICLE
		$this->web_article = $this->basic;
		$this->web_article['title'] = 'atitle';
		$this->web_article['collectionTitle'] = 'jtitle';
		$this->web_article['collectionTitleShort'] = 'stitle';
		$this->web_article['field1'] = 'volume';
		$this->web_article['field2'] = 'issue';
		$this->web_article['pageStart'] = 'spage';
		$this->web_article['pageEnd'] = 'epage';
		$this->web_article['publisherName'] = 'pub';
		$this->web_article['publisherLocation'] = 'place';
// WEB ENCYCLOPEDIA
		$this->web_encyclopedia = $this->basic;
		$this->web_encyclopedia['title'] = 'jtitle';
		$this->web_encyclopedia['publisherName'] = 'pub';
		$this->web_encyclopedia['publisherLocation'] = 'place';
// WEB ENCYCLOPEDIA ARTICLE
		$this->web_encyclopedia_article = $this->basic;
		$this->web_encyclopedia_article['title'] = 'atitle';
		$this->web_encyclopedia_article['publisherName'] = 'pub';
		$this->web_encyclopedia_article['publisherLocation'] = 'place';
		$this->web_encyclopedia_article['collectionTitle'] = 'jtitle';
		$this->web_encyclopedia_article['collectionTitleShort'] = 'stitle';
		$this->web_encyclopedia_article['pageStart'] = 'spage';
		$this->web_encyclopedia_article['pageEnd'] = 'epage';
// FILM
		$this->film = $this->basic;
		$this->film['title'] = 'btitle';
// BROADCAST
		$this->broadcast = $this->basic;
		$this->broadcast['title'] = 'btitle';
		$this->broadcast['publisherName'] = 'pub';
		$this->broadcast['publisherLocation'] = 'place';
// SOFTWARE
		$this->software = $this->basic;
		$this->software['title'] = 'btitle';
		$this->software['publisherName'] = 'pub';
		$this->software['publisherLocation'] = 'place';
// ARTWORK
		$this->artwork = $this->basic;
		$this->artwork['title'] = 'btitle';
		$this->artwork['publisherName'] = 'pub';
		$this->artwork['publisherLocation'] = 'place';
// AUDIOVISUAL
		$this->audiovisual = $this->basic;
		$this->audiovisual['title'] = 'btitle';
		$this->audiovisual['field1'] = 'series';
		$this->audiovisual['publisherName'] = 'pub';
		$this->audiovisual['publisherLocation'] = 'place';
// (LEGAL) CASE
		$this->case = $this->basic;
		$this->case['title'] = 'atitle';
		$this->case['field4'] = 'btitle';
		$this->case['publisherName'] = 'pub';
		$this->case['isbn'] = 'isbn';
// LEGAL RULING/REGULATION
		$this->legal_ruling = $this->basic;
		$this->legal_ruling['title'] = 'btitle';
		$this->legal_ruling['field3'] = 'edition';
		$this->legal_ruling['publisherName'] = 'pub';
		$this->legal_ruling['publisherLocation'] = 'place';
		$this->legal_ruling['pageStart'] = 'spage';
		$this->legal_ruling['pageEnd'] = 'epage';
		$this->legal_ruling['isbn'] = 'isbn';
// (PARLIAMENTARY) BILL
		$this->bill = $this->basic;
		$this->bill['title'] = 'btitle';
		$this->bill['field4'] = 'edition';
		$this->bill['publisherName'] = 'pub';
		$this->bill['publisherLocation'] = 'place';
		$this->bill['pageStart'] = 'spage';
		$this->bill['pageEnd'] = 'epage';
// CLASSICAL WORK
		$this->classical = $this->basic;
		$this->classical['title'] = 'btitle';
		$this->classical['field4'] = 'edition';
		$this->classical['isbn'] = 'isbn';
// CONFERENCE PAPER
		$this->conference_paper = $this->basic;
		$this->conference_paper['title'] = 'atitle';
		$this->conference_paper['collectionTitle'] = 'btitle';
		$this->conference_paper['collectionTitleShort'] = 'stitle';
		$this->conference_paper['publisherName'] = 'pub';
		$this->conference_paper['publisherLocation'] = 'place';
		$this->conference_paper['isbn'] = 'isbn';
// MISCELLANEOUS
		$this->miscellaneous = $this->basic;
		$this->miscellaneous['title'] = 'btitle';
		$this->miscellaneous['publisherName'] = 'pub';
		$this->miscellaneous['publisherLocation'] = 'place';
// MISCELLANEOUS SECTION
		$this->miscellaneous_section = $this->basic;
		$this->miscellaneous_section['title'] = 'atitle';
		$this->miscellaneous_section['publisherName'] = 'pub';
		$this->miscellaneous_section['publisherLocation'] = 'place';
		$this->miscellaneous_section['collectionTitle'] = 'btitle';
		$this->miscellaneous_section['collectionTitleShort'] = 'stitle';
		$this->miscellaneous_section['pageStart'] = 'spage';
		$this->miscellaneous_section['pageEnd'] = 'epage';
// GOVERNMENT REPORT/DOCUMENTATION
		$this->government_report = $this->basic;
		$this->government_report['title'] = 'btitle';
		$this->government_report['field4'] = 'series';
		$this->government_report['field3'] = 'edition';
		$this->government_report['publisherName'] = 'publ';
		$this->government_report['publisherLocation'] = 'place';
		$this->government_report['pageStart'] = 'spage';
		$this->government_report['pageEnd'] = 'epage';
		$this->government_report['isbn'] = 'issn';
// REPORT/DOCUMENTATION
		$this->report = $this->basic;
		$this->report['field1'] = 'series';
		$this->report['field5'] = 'edition';
		$this->report['publisherName'] = 'pub';
		$this->report['publisherLocation'] = 'place';
		$this->report['pageStart'] = 'spage';
		$this->report['pageEnd'] = 'epage';
		$this->report['isbn'] = 'issn';
		$this->report['title'] = 'btitle';
// GOVERNMENT/LEGAL HEARING
		$this->hearing = $this->basic;
		$this->hearing['title'] = 'btitle';
		$this->hearing['field1'] = 'series';
		$this->hearing['field4'] = 'edition';
		$this->hearing['publisherName'] = 'pub';
		$this->hearing['publisherLocation'] = 'place';
		$this->hearing['pageStart'] = 'spage';
		$this->hearing['pageEnd'] = 'epage';
		$this->hearing['isbn'] = 'issn';
// ONLINE DATABASE
		$this->database = $this->basic;
		$this->database['title'] = 'btitle';
		$this->database['publisherName'] = 'pub';
		$this->database['publisherLocation'] = 'place';
// MANUSCRIPT
		$this->manuscript = $this->basic;
		$this->manuscript['title'] = 'atitle';
		$this->manuscript['collectionTitle'] = 'btitle';
		$this->manuscript['collectionTitleShort'] = 'stitle';
		$this->manuscript['field3'] = 'edition';
		$this->manuscript['pageStart'] = 'spage';
		$this->manuscript['pageEnd'] = 'epage';
		$this->manuscript['isbn'] = 'isbn';
// MAP
		$this->map = $this->basic;
		$this->map['title'] = 'btitle';
		$this->map['field1'] = 'series';
		$this->map['field3'] = 'edition';
		$this->map['publisherName'] = 'pub';
		$this->map['publisherLocation'] = 'place';
		$this->map['isbn'] = 'isbn';
// CHART
		$this->chart = $this->basic;
		$this->chart['title'] = 'btitle';
		$this->chart['publisherName'] = 'pub';
		$this->chart['publisherLocation'] = 'place';
// STATUTE
		$this->statute = $this->basic;
		$this->statute['field2'] = 'series';
		$this->statute['field5'] = 'edition';
		$this->statute['pageStart'] = 'spage';
		$this->statute['pageEnd'] = 'epage';
		$this->statute['title'] = 'btitle';
// PATENT
		$this->patent = $this->basic;
		$this->patent['title'] = 'title';
		$this->patent['field8'] = 'number';
		$this->patent['field3'] = 'applnumber';
		$this->patent['field4'] = 'kind';
		$this->patent['publisherName'] = 'assignee';
		$this->patent['publisherLocation'] = 'co';
// PERSONAL COMMUNICATION
		$this->personal = $this->basic;
		$this->personal['title'] = 'btitle';
// PROCEEDINGS (complete set of)
		$this->proceedings = $this->basic;
		$this->proceedings['title'] = 'btitle';
		$this->proceedings['publisherName'] = 'pub';
		$this->proceedings['publisherLocation'] = 'place';
		$this->proceedings['isbn'] = 'issn';
// MUSIC ALBUM
		$this->music_album = $this->basic;
		$this->music_album['title'] = 'btitle';
		$this->music_album['publisherName'] = 'pub';
		$this->music_album['isbn'] = 'isbn';
// MUSIC TRACK
		$this->music_track = $this->basic;
		$this->music_track['title'] = 'atitle';
		$this->music_track['collectionTitle'] = 'btitle';
		$this->music_track['collectionTitleShort'] = 'stitle';
		$this->music_track['publisherName'] = 'pub';
		$this->music_track['isbn'] = 'isbn';
// MUSIC SCORE
		$this->music_score = $this->basic;
		$this->music_score['title'] = 'btitle';
		$this->music_score['field3'] = 'edition';
		$this->music_score['publisherName'] = 'pub';
		$this->music_score['publisherLocation'] = 'place';
		$this->music_score['isbn'] = 'isbn';
// UNPUBLISHED WORK
		$this->unpublished = $this->basic;
		$this->unpublished['title'] = 'btitle';
		$this->unpublished['publisherName'] = 'pub';
		$this->unpublished['publisherLocation'] = 'place';
	}
}
?>
